<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
	<%@ include file="/static/admin/jsp/include.jsp"%>
	<script type="text/javascript">
        var grid;

        var editFun = function($dialog, $grid, $pjq) {
            var rows = grid.datagrid('getSelections');
            if (rows.length != 1) {
                parent.$.messager.w('请选择一条记录进行编辑！');
                return;
            }
            var dialog = parent.sy.modalDialog({
                title : '修改',
                width : 800,
                height : 600,
                url : sy.contextPath + '/go?path=param/yearEdit&id=' + rows[0].id,
                buttons : [ {
                    text : '保存',
                    handler : function() {
                        dialog.find('iframe').get(0).contentWindow.submitForm(dialog, grid, parent.$);
                    }
                } ]
            });
        };

        $(function() {

            grid = $('#grid').datagrid({
                url : sy.contextPath + '/yearParam/list',
                singleSelect : true,
                columns : [ [
                    {
                        width : $(this).width() * 0.1,
                        title : '年份最低值',
                        field : 'minYear',
                        align : 'center',
                    },{
                        width : $(this).width() * 0.08,
                        title : '年份最大值',
                        field : 'maxYear',
                        align : 'center'
                    }
                ] ]
            });
        });
	</script>
</head>
<body>
<div id="toolbar">
	<form id="searchForm">
		<div>
		</div>
	</form>
	<div class="tbbutton">
		<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'fa-pencil',plain:true" onclick="editFun();">修改</a>
	</div>
</div>
<table id="grid" data-options="fit:true,border:false"></table>
</body>
</html>